<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="PersonDetail.aspx.cs" Inherits="PersonDetail" Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <br />
    <asp:GridView ID="GridView_RaidFights" runat="server" AutoGenerateColumns="False"
        CellPadding="4" DataSourceID="SqlDataSource_RaidFights" ForeColor="#333333" GridLines="None" AllowSorting="True" AllowPaging="True" DataKeyNames="FightID">
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <EditRowStyle BackColor="#999999" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:CommandField ShowSelectButton="True" />
            <asp:BoundField DataField="FightID" HeaderText="FightID" SortExpression="FightID" />
            <asp:BoundField DataField="BeginTime" HeaderText="BeginTime" SortExpression="BeginTime" />
            <asp:BoundField DataField="DamageOut" HeaderText="DamageOut" SortExpression="DamageOut" />
            <asp:BoundField DataField="LastDeath" HeaderText="LastDeath" SortExpression="LastDeath" />
            <asp:BoundField DataField="TimeInCombat" HeaderText="TimeInCombat" SortExpression="TimeInCombat" />
            <asp:BoundField DataField="DPS" HeaderText="DPS" SortExpression="DPS" />
            <asp:BoundField DataField="HPS" HeaderText="HPS" SortExpression="HPS" />
        </Columns>
    </asp:GridView>
    <br />
    <asp:GridView ID="GridView_AbilityMeters" runat="server" AllowSorting="True"
        AutoGenerateColumns="False" BackColor="White" BorderColor="#999999" BorderStyle="Solid"
        BorderWidth="1px" CellPadding="3" DataSourceID="SqlDataSource_AbilityDetail"
        ForeColor="Black" GridLines="Vertical">
        <FooterStyle BackColor="#CCCCCC" />
        <Columns>
            <asp:BoundField DataField="Text" HeaderText="Text" SortExpression="Text" />
            <asp:BoundField DataField="DamageOut" HeaderText="DamageOut" SortExpression="DamageOut" />
            <asp:BoundField DataField="DPS" HeaderText="DPS" SortExpression="DPS" />
            <asp:BoundField DataField="DamageIn" HeaderText="DamageIn" SortExpression="DamageIn" />
            <asp:BoundField DataField="HealingOut" HeaderText="HealingOut" SortExpression="HealingOut" />
            <asp:BoundField DataField="HPS" HeaderText="HPS" SortExpression="HPS" />
            <asp:BoundField DataField="HealingIn" HeaderText="HealingIn" SortExpression="HealingIn" />
        </Columns>
        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="#CCCCCC" />
    </asp:GridView>
    <br />
    <asp:GridView ID="GridView_TargetMeters" runat="server" AllowSorting="True" AutoGenerateColumns="False"
        BackColor="White" BorderColor="#999999" BorderStyle="Solid" BorderWidth="1px"
        CellPadding="3" DataSourceID="SqlDataSource_TargetDetail" ForeColor="Black" GridLines="Vertical">
        <FooterStyle BackColor="#CCCCCC" />
        <Columns>
            <asp:BoundField DataField="PublicText" HeaderText="PublicText" SortExpression="PublicText" />
            <asp:BoundField DataField="DamageOut" HeaderText="DamageOut" SortExpression="DamageOut" />
            <asp:BoundField DataField="DPS" HeaderText="DPS" SortExpression="DPS" />
            <asp:BoundField DataField="DamageIn" HeaderText="DamageIn" SortExpression="DamageIn" />
            <asp:BoundField DataField="HealingOut" HeaderText="HealingOut" SortExpression="HealingOut" />
            <asp:BoundField DataField="HPS" HeaderText="HPS" SortExpression="HPS" />
            <asp:BoundField DataField="HealingIn" HeaderText="HealingIn" SortExpression="HealingIn" />
        </Columns>
        <SelectedRowStyle BackColor="#000099" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#999999" ForeColor="Black" HorizontalAlign="Center" />
        <HeaderStyle BackColor="Black" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="#CCCCCC" />
    </asp:GridView>
    <br />
    <br />
    <asp:SqlDataSource ID="SqlDataSource_RaidFights" runat="server" ConnectionString="<%$ ConnectionStrings:RaidLog.Engine.Properties.Settings.RaidLogConnectionString %>" ProviderName="<%$ ConnectionStrings:RaidLog.Engine.Properties.Settings.RaidLogConnectionString.ProviderName %>"
        SelectCommand="select vFightInfo.FightID, vFightInfo.BeginTime, vFightInfo.DamageOut, vFightInfo.LastDeath, vFightMeters.TimeInCombat, vFightMeters.DPS, vFightMeters.HPS&#13;&#10;from vFightInfo&#13;&#10;&#9;inner join vFightMeters on vFightMeters.FightID = vFightInfo.FightID and vFightMeters.NounID = @PersonID&#13;&#10;order by vFightInfo.BeginTime, vFightInfo.EndTime&#13;&#10;">
        <SelectParameters>
            <asp:QueryStringParameter DefaultValue="0" Name="PersonID" QueryStringField="PersonID" />
        </SelectParameters>
    </asp:SqlDataSource><asp:SqlDataSource ID="SqlDataSource_AbilityDetail" runat="server" ConnectionString="<%$ ConnectionStrings:RaidLog.Engine.Properties.Settings.RaidLogConnectionString %>" ProviderName="<%$ ConnectionStrings:RaidLog.Engine.Properties.Settings.RaidLogConnectionString.ProviderName %>"
        SelectCommand="with DamageOut(VerbID, DamageOut) as (&#13;&#10;&#9;select VerbID, Sum([Value]) DamageOut &#13;&#10;&#9;from faaMeter4d&#13;&#10;&#9;where MeterTypeID = 1 and FightID = @FightID and SubjectID = @PersonID&#13;&#10;&#9;group by VerbID&#13;&#10;), DamageIn(VerbID, DamageIn) as (&#13;&#10;&#9;select VerbID, Sum([Value]) DamageIn &#13;&#10;&#9;from faaMeter4d&#13;&#10;&#9;where MeterTypeID = 1 and FightID = @FightID and TargetID = @PersonID&#13;&#10;&#9;group by VerbID&#13;&#10;), HealingOut(VerbID, HealingOut) as (&#13;&#10;&#9;select VerbID, Sum([Value]) HealingOut &#13;&#10;&#9;from faaMeter4d&#13;&#10;&#9;where MeterTypeID = 2 and FightID = @FightID and SubjectID = @PersonID&#13;&#10;&#9;group by VerbID&#13;&#10;), HealingIn(VerbID, HealingIn) as (&#13;&#10;&#9;select VerbID, Sum([Value]) HealingIn &#13;&#10;&#9;from faaMeter4d&#13;&#10;&#9;where MeterTypeID = 2 and FightID = @FightID and TargetID = @PersonID&#13;&#10;&#9;group by VerbID&#13;&#10;) select &#13;&#10;&#9;&#9;mtVerb.[Text], &#13;&#10;&#9;&#9;DamageOut.DamageOut,&#13;&#10;&#9;&#9;DamageOut.DamageOut/vFightMeters.TimeInCombat DPS,&#13;&#10;&#9;&#9;DamageIn.DamageIn,&#13;&#10;&#9;&#9;HealingOut.HealingOut,&#13;&#10;&#9;&#9;HealingOut.HealingOut/vFightMeters.TimeInCombat HPS,&#13;&#10;&#9;&#9;HealingIn.HealingIn&#13;&#10;&#9;from mtVerb&#13;&#10;&#9;full outer join vFightMeters on vFightMeters.NounID = @PersonID and vFightMeters.FightID = @FightID&#13;&#10;&#9;full outer join DamageOut on DamageOut.VerbID = mtVerb.VerbID&#13;&#10;&#9;full outer join DamageIn on DamageIn.VerbID = mtVerb.VerbID&#13;&#10;&#9;full outer join HealingOut on HealingOut.VerbID = mtVerb.VerbID&#13;&#10;&#9;full outer join HealingIn on HealingIn.VerbID = mtVerb.VerbID&#13;&#10;&#9;where mtVerb.[Text] is not null and (DamageOut.DamageOut is not null or HealingOut.HealingOut is not null or HealingIn.HealingIn is not null )">
        <SelectParameters>
            <asp:ControlParameter ControlID="GridView_RaidFights" DefaultValue="0" Name="FightID"
                PropertyName="SelectedValue" />
            <asp:QueryStringParameter DefaultValue="0" Name="PersonID" QueryStringField="PersonID" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource_TargetDetail" runat="server" ConnectionString="<%$ ConnectionStrings:RaidLog.Engine.Properties.Settings.RaidLogConnectionString %>" ProviderName="<%$ ConnectionStrings:RaidLog.Engine.Properties.Settings.RaidLogConnectionString.ProviderName %>"
        SelectCommand="with DamageOut(VerbID, DamageOut) as (&#13;&#10;&#9;select TargetID, Sum([Value]) DamageOut &#13;&#10;&#9;from faaMeter4d&#13;&#10;&#9;where MeterTypeID = 1 and FightID = @FightID and SubjectID = @PersonID&#13;&#10;&#9;group by TargetID&#13;&#10;), DamageIn(VerbID, DamageIn) as (&#13;&#10;&#9;select SubjectID, Sum([Value]) DamageIn &#13;&#10;&#9;from faaMeter4d&#13;&#10;&#9;where MeterTypeID = 1 and FightID = @FightID and TargetID = @PersonID&#13;&#10;&#9;group by SubjectID&#13;&#10;), HealingOut(VerbID, HealingOut) as (&#13;&#10;&#9;select TargetID, Sum([Value]) HealingOut &#13;&#10;&#9;from faaMeter4d&#13;&#10;&#9;where MeterTypeID = 2 and FightID = @FightID and SubjectID = @PersonID&#13;&#10;&#9;group by TargetID&#13;&#10;), HealingIn(VerbID, HealingIn) as (&#13;&#10;&#9;select SubjectID, Sum([Value]) HealingIn &#13;&#10;&#9;from faaMeter4d&#13;&#10;&#9;where MeterTypeID = 2 and FightID = @FightID and TargetID = @PersonID&#13;&#10;&#9;group by SubjectID&#13;&#10;) select &#13;&#10;&#9;&#9;mtNoun.PublicText, &#13;&#10;&#9;&#9;DamageOut.DamageOut,&#13;&#10;&#9;&#9;DamageOut.DamageOut/vFightMeters.TimeInCombat DPS,&#13;&#10;&#9;&#9;DamageIn.DamageIn,&#13;&#10;&#9;&#9;HealingOut.HealingOut,&#13;&#10;&#9;&#9;HealingOut.HealingOut/vFightMeters.TimeInCombat HPS,&#13;&#10;&#9;&#9;HealingIn.HealingIn&#13;&#10;&#9;from mtNoun&#13;&#10;&#9;full outer join vFightMeters on vFightMeters.NounID = @PersonID and vFightMeters.FightID = @FightID&#13;&#10;&#9;full outer join DamageOut on DamageOut.VerbID = mtNoun.NounID&#13;&#10;&#9;full outer join DamageIn on DamageIn.VerbID = mtNoun.NounID&#13;&#10;&#9;full outer join HealingOut on HealingOut.VerbID = mtNoun.NounID&#13;&#10;&#9;full outer join HealingIn on HealingIn.VerbID = mtNoun.NounID&#13;&#10;&#9;where mtNoun.PublicText is not null and (DamageOut.DamageOut is not null or HealingOut.HealingOut is not null or HealingIn.HealingIn is not null )">
        <SelectParameters>
            <asp:ControlParameter ControlID="GridView_RaidFights" DefaultValue="0" Name="FightID"
                PropertyName="SelectedValue" />
            <asp:QueryStringParameter DefaultValue="0" Name="PersonID" QueryStringField="PersonID" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>

